/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.subway.persistencias;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Héctor <UFG>
 */
@Entity
@Table(name = "prod_categoria", catalog = "bd_subway", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ProdCategoria.findAll", query = "SELECT p FROM ProdCategoria p"),
    @NamedQuery(name = "ProdCategoria.findByCatId", query = "SELECT p FROM ProdCategoria p WHERE p.catId = :catId"),
    @NamedQuery(name = "ProdCategoria.findByCatNombre", query = "SELECT p FROM ProdCategoria p WHERE p.catNombre = :catNombre"),
    @NamedQuery(name = "ProdCategoria.findByCatSize", query = "SELECT p FROM ProdCategoria p WHERE p.catSize = :catSize"),
    @NamedQuery(name = "ProdCategoria.findByCatPrecio", query = "SELECT p FROM ProdCategoria p WHERE p.catPrecio = :catPrecio")})
public class ProdCategoria implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "catId", nullable = false)
    private Integer catId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 40)
    @Column(name = "catNombre", nullable = false, length = 40)
    private String catNombre;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 40)
    @Column(name = "catSize", nullable = false, length = 40)
    private String catSize;
    @Basic(optional = false)
    @NotNull
    @Column(name = "catPrecio", nullable = false)
    private double catPrecio;

    public ProdCategoria() {
    }

    public ProdCategoria(Integer catId) {
        this.catId = catId;
    }

    public ProdCategoria(Integer catId, String catNombre, String catSize, double catPrecio) {
        this.catId = catId;
        this.catNombre = catNombre;
        this.catSize = catSize;
        this.catPrecio = catPrecio;
    }

    public Integer getCatId() {
        return catId;
    }

    public void setCatId(Integer catId) {
        this.catId = catId;
    }

    public String getCatNombre() {
        return catNombre;
    }

    public void setCatNombre(String catNombre) {
        this.catNombre = catNombre;
    }

    public String getCatSize() {
        return catSize;
    }

    public void setCatSize(String catSize) {
        this.catSize = catSize;
    }

    public double getCatPrecio() {
        return catPrecio;
    }

    public void setCatPrecio(double catPrecio) {
        this.catPrecio = catPrecio;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (catId != null ? catId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ProdCategoria)) {
            return false;
        }
        ProdCategoria other = (ProdCategoria) object;
        if ((this.catId == null && other.catId != null) || (this.catId != null && !this.catId.equals(other.catId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return this.catNombre;
    }
    
}
